import allure

from page_element.roncoo_power_manage import role
from page_object.roncoo_login import RoncooLogin
from page_element.el_A3mall import *
import logging
from utils.timer import sleep



class Add_Role(RoncooLogin):
    """添加角色"""

    def page_add_role_login(self, info1,info2,info3):
        # 前置条件：已登录
        self.roncoo_login()
        with allure.step(f"点击权限管理"):
            self.click(role.power_manage)
            sleep(2)
        with allure.step(f"点击角色管理"):
            self.click(role.role_manage)
            sleep(2)
        with allure.step(f"点击添加角色"):
            self.click(role.add_role)
            sleep(2)
        with allure.step(f"输入角色名称"):
            self.send_keys(role.role_name,info1)
            sleep(2)
        with allure.step(f"输入角色编码"):
            self.send_keys(role.role_number,info2)
            sleep(2)
        with allure.step(f"输入角色描述"):
            self.send_keys(role.role_desc,info3)
            sleep(2)
        with allure.step(f"点击保存"):
            self.click(role.save_btn)
            sleep(2)
